/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { checkInMicroMessenger } from '@/utils/utils';
import { Result } from 'antd';
import React, { useEffect } from 'react';
import { useDispatch } from 'umi';
import styles from './SecurityLayout.less';

interface SecurityLayoutProps {}

const SecurityLayout: React.FC<SecurityLayoutProps> = (props) => {
  const subTitle = checkInMicroMessenger();
  const dispatch = useDispatch();

  useEffect(() => {
    dispatch({
      type: 'user/fetchCurrent',
    });
  }, []);
  return (
    <>
      {!subTitle ? (
        props.children
      ) : (
        <Result className={styles.result} status={404} title={404} subTitle={subTitle} />
      )}
    </>
  );
};

export default SecurityLayout;
